package controller;

import java.util.ArrayList;

import manager.CourseMgr;
import manager.CoursePreRequisiteMgr;
import entity.Course;

/**
 * @author sheryl.tay.2012, mohameds.2012
 * 
 */
public class CourseCtrl {

	private CourseMgr courseMgr;
	private CoursePreRequisiteMgr coursePreRequisiteMgr;

	public CourseCtrl() {
		courseMgr = new CourseMgr();
		coursePreRequisiteMgr = new CoursePreRequisiteMgr();
	}

	public void addCourse(Course course) {
		courseMgr.addCourse(course);
	}

	public void addPreRequisiteForCourse(String preRequisiteCode,
			String courseCode) {
		coursePreRequisiteMgr.addPreRequisiteForCourse(preRequisiteCode,
				courseCode);
	}

	public Course retrieveCourseForCourseCode(String courseCode) {
		return courseMgr.retrieveCourseForCourseCode(courseCode);
	}

	public ArrayList<Course> retrieveAllCourses() {
		return courseMgr.retrieveAllCourses();
	}

	public ArrayList<Course> retrievePreRequisitesForCourse(String courseCode) {
		return coursePreRequisiteMgr.retrievePreRequisitesForCourse(courseCode);
	}

	public ArrayList<Course> retrieveCoursesOfferedBySchool(String school) {
		return courseMgr.retrieveCoursesOfferedBySchool(school);
	}

	public ArrayList<String> retrieveAllSchoolsThatHaveCourses() {
		return courseMgr.retrieveAllSchoolsThatHaveCourses();
	}

}
